<?php

class modActions extends model
{
	function add($data, $type)
	{
		$this->query("INSERT INTO actions (`time`,`type`,`data`) VALUES ('" . time() . "', '" . $type . "', '" . addslashes($data) . "');");
		
	} // end function
	
	function getSince($time)
	{
		$actions = array();
		$sActions = $this->query("SELECT * FROM actions WHERE time >= '" . $time . "'");
		
		
		if ($this->num($sActions) == 0)
			return array();
		
		while ($fAction = $this->fetch($sActions))
		{
			$actions[$fAction['type']][] = $fAction['data'];
			
		} // end while
		
		return $actions;
		
	} // end function
	
} // end class

$_ = 'modActions';

?>